<?php include "../../config.php";?>
<?php include ROOT_PATH_."/front/m2/coresection/checkUserSession.php";?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include 'modules/head.php'; ?>
<? $orderlist     = select_lines_all_items   ($table_prefix."orderlist","order_date desc","user_id = '".$userinfo['mid']."'","100");

?>

</head>

<body id="order_list">



<div class="topbar"><?php include 'modules/topbar.php'; ?></div>

<div class="container">




<div id='content' class="layui-form order_list" >
    <h2>订餐记录</h2>

    <form name="orderlist" id="orderlist" action="coresection/order_cancel.php">
    <table class="layui-table">
        <colgroup>
            <col width="100" >
            <col >
            <col width="150" >
            <col width="150" >
        </colgroup>
        <thead>
        <tr>
            <th>序号</th>
            <th>菜式</th>
            <th>日期</th>
            <th>选择订单</th>
        </tr>
        </thead>
        <tbody>
        <tr>

            <?
            $meal['1']="早";
            $meal['2']="午";
            $meal['3']="晚";
            ?>



            <?for($i=0;$i<count($orderlist);$i++){?>
            <td><span class="layui-bg-green data"><?echo $meal[$orderlist[$i]['order_at']]?></span></td>

            <? $conditon['str']=$orderlist[$i]['product_name'];
               $conditon['from']='0';
               $conditon['len']='11';
               $conditon['ellipsis']="...";
            ?>
            <td><?echo utf8_substr($conditon)?></td>
            <td><?echo substr($orderlist[$i]['order_date'],5,10)?></td>
            <td class="function">






                <?
				//前一日的话，还需要在六点钟之前才能退订哦。
				
				
				//请增加上去
				//前一日的话，还需要在六点钟之前才能退订哦。
				//前一日的话，还需要在六点钟之前才能退订哦。
				//前一日的话，还需要在六点钟之前才能退订哦。
				//前一日的话，还需要在六点钟之前才能退订哦。
				//前一日的话，还需要在六点钟之前才能退订哦。
				//前一日的话，还需要在六点钟之前才能退订哦。
                if(( $orderlist[$i]['order_date']>date("Y-m-d")) and ($orderlist[$i]['status']!='取消')){?>
<input type="checkbox" name="orderid[]" value="<?echo $orderlist[$i]['nid']?>" title="<?echo $orderlist[$i]['product_price']?>元">
                <?}
                elseif ($orderlist[$i]['status']=='取消')
                {echo "取消订单";}
                else{?>
                    已过期
                <?}?>

            </td>
        </tr>
        <?}?>

        </tbody>
    </table>
    </form>


</div>








</div>



<div class="dishesfooter">

    <div id="cancel_order_button" class="footer_button">退订</div>
</div>




<div class="footer"><?php include 'modules/footer.php'; ?></div>
</body>
</html>

<script>
    //计算要退订的个数
    $("#cancel_order_button").click(function(){
        var form = document.getElementById('orderlist');
        form.submit();
    });



</script>